
#include "widget.h"

#include <QApplication>

#include <QLocale>
#include <QTranslator>

#include <QSqlDatabase>
#include <QMessageBox>
int main(int argc, char *argv[])
{
    //输出可用数据库
    qDebug()<<"available drivers:";
    QStringList drivers = QSqlDatabase::drivers();
    foreach(QString driver, drivers)
        qDebug()<<driver;
    QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");




    QApplication a(argc, argv);

    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString &locale : uiLanguages) {
        const QString baseName = "dataBase_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }
    Widget w;
    w.show();
    return a.exec();
}
